﻿Imports System.Data
Imports VSModel
Imports Cls_Common
Imports SecurityService
Partial Class Control_NopThue_ContentEditor
    Inherits System.Web.UI.UserControl
    Private Shared ReadOnly log As log4net.ILog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)
#Region "Sub and Function "
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            'active tab tuong ung voi Page
            'InVisble button ko can thiet
            setPermission()
            If Request.PhysicalPath.Contains("List.aspx") Then
                lbtList.CssClass = "current_manage"
                lbtList.Text = "<span class=""current_manage"">Danh sách</span>"
                setPermission()
            ElseIf Request.PhysicalPath.Contains("Import.aspx") Then
                lbtImport.CssClass = "current_manage"
                lbtImport.Text = "<span class=""current_manage"">Cập nhật từ Excel</span>"
                setPermission()
            ElseIf Request.PhysicalPath.Contains("DoiXung.aspx") Then
                lbtDoiXung.CssClass = "current_manage"
                lbtDoiXung.Text = "<span class=""current_manage"">Cập nhật từ Excel</span>"
                setPermission()
            End If
        
        End If
    End Sub
    Protected Sub setPermission()
        lbtImport.Visible = HasPermission(Function_Name.QuanLyMST, Session("RoleID"), 0, Audit_Type.Create)
        lbtList.Visible = HasPermission(Function_Name.QuanLyMST, Session("RoleID"), 0, Audit_Type.ViewContent)
        lbtDoiXung.Visible = HasPermission(Function_Name.QuanLyMST, Session("RoleID"), 0, Audit_Type.ViewContent)
    End Sub
    Protected Sub lbtList_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbtList.Click
        Response.Redirect("List.aspx")
    End Sub
#End Region

    Protected Sub lbtImport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbtImport.Click
        Response.Redirect("Import.aspx")
    End Sub

    Protected Sub lbtDoiXung_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbtDoiXung.Click
        Response.Redirect("DoiXung.aspx")
    End Sub
End Class
